package com.novax.ex.activity.infrastructure.mapper;

import com.novax.ex.activity.infrastructure.entity.IeoStages;
import com.novax.ex.common.base.BaseMapper;

import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
 * @Description IEO分期表
 * @Author ChenXi
 * @Date 2023/05/05/16:53
 */
 

public interface IeoStagesMapper extends BaseMapper {

    /**
     * @Description: 获取ieo所有分期配置
     * @Author: ChenXi
     * @Date:  2023/5/6 11:23
     * @param
     * @return: java.util.List<com.novax.ex.activity.infrastructure.entity.IeoStages>
     **/
    List<IeoStages> findByIeoId(@Param("ieoId") Long ieoId, @Param("now") Date now);

    /**
     * @Description: 查询最后一期的id
     * @Author: ChenXi
     * @Date:  2023/5/8 09:55
     * @param ieoId
     * @return: java.lang.Long
     **/
    Long findLastIdByIeoId(@Param("ieoId") Long ieoId);

    /**
     * @Description: 查询所有配置
     * @Author: ChenXi
     * @Date:  2023/5/11 15:05
     * @param ieoId
     * @return: java.util.List<com.novax.ex.activity.infrastructure.entity.IeoStages>
     **/
    List<IeoStages> findListByIeoId(@Param("ieoId") Long ieoId);

    /**
     * @Description: 批量添加
     * @Author: ChenXi
     * @Date:  2023/5/11 15:19
     * @param list
     * @return: java.lang.Integer
     **/
    int batchInsert(@Param("list") List<IeoStages> list);

    int deleteByIeoId(@Param("ieoId") Long ieoId);

}